package com.wy.service;

import com.wy.mapper.CourseMapper;
import com.wy.pojo.Course;
import com.wy.pojo.CourseExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wuyue
 * @date 2020/1/6 23:21
 */
@Service
public class CourseService {
       @Autowired
       private CourseMapper courseMapper;

      public List<Course>  findByName(String name){
          CourseExample courseExample=new CourseExample();
          CourseExample.Criteria criteria = courseExample.createCriteria();
          criteria.andCNameLike("%"+name+"%");
        return   courseMapper.selectByExample(courseExample);
      }
}
